package web.controller.emergController;


import cn.hutool.core.util.RandomUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import web.entity.User2;
import web.utils.PictureUtils;
import web.utils.RandomUtils;
import web.utils.VideoUtils;

@RestController
@RequestMapping("/getCoverTest")
public class getCoverTest {

    @Value("${filePath.VideoPath}")
    private String VideoPath;

    @Value("${filePath.PicPath}")
    private String PicPath;



    @GetMapping("/Test")
    //用于视频截图。。。。。使用
    public void mySql1() {
        String path =VideoPath+ "\\"+ "1.mp4";
        String s = VideoUtils.fetchFrame(path);
        String suffix = "png";//图片文件的后缀名。可以是jpg、gif
        String filePath = RandomUtils.getRandomString(suffix);
        String newFileName = PicPath+"\\"+filePath;//在Eclipse里面，生成的文件也在工程文件夹下

       // PictureUtils.base64StringToImage(s, newFileName, suffix);
    }
 }

